# oE6 Makefile.
# $Id: GNUmakefile 4 2008-12-13 13:14:29Z interblooper $


#
# Build configuration.
#

TARGETS += oE6

# 0 = stripped, optimised binary, 1 = unstripped with-symbols binary.
DEBUG ?= 1


#
# Compiler configuration.
#

# GCC_WARN_UNUSED_VARIABLE = YES;
CFLAGS += -Wunused-variable

# GCC_WARN_ABOUT_RETURN_TYPE = YES;
CFLAGS += -Wreturn-type

# GCC_C_LANGUAGE_STANDARD = c99;
CFLAGS += -std=c99

ifeq ($(DEBUG),1)

# Disable optimisation.
CFLAGS += -O0

# Enable debug data output.
CFLAGS += -g

else # DEBUG?

# Enable optimisation.
CFLAGS += -O2

endif


#
# Generic targets.
#

default: all

ifeq ($(DEBUG),1)
default: strip-targets
endif

all: $(TARGETS)

strip-targets:
	strip $(TARGETS)

clean:
	rm -f *.o $(TARGETS)

# Permit simple 'make debug' to completely rebuild.
debug:
	$(MAKE) clean default DEBUG=1

# Permit simple 'make release' to completely rebuild.
release:
	$(MAKE) clean default DEBUG=0


#
# oE6 target.
#

OE6_OBJS += fileIO.o
OE6_OBJS += mp3decoder.o
OE6_OBJS += header.o
OE6_OBJS += sideinfo.o
OE6_OBJS += bitstream.o
OE6_OBJS += main.o

oE6: $(OE6_OBJS)
	$(CC)  -o $@ $(OE6_OBJS)
